﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace MaxLeaf.Platform.DataContract
{

    /// <summary>
    /// 用户信息
    /// </summary>
    [Serializable]
    [DataContract]
    [CommonsLib.ORM.DataTable(DBName = "MaxleafSCPBase", TableName = "mUser_Main", KeyPropName = "Key", ForeignKeyPropName = "ForeignKey")]
    public class mUser_MainDataModel : BaseDataModel
    {
        /// <summary>
        /// 用户id
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("UserID", "int", 4)]
        public int Key { get; set; }

        /// <summary>
        ///  关联的人员信息
        /// </summary>         
        public mUser_InfoDataModel Sub_Info
        {
            get
            {
                return GetSubData<mUser_InfoDataModel>(this.Key, "Key");
            }
            set
            {
                SetSubData<mUser_InfoDataModel>(this.Key, "Key", value);
            }
        }

        /// <summary>
        /// 公司id
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("CompanyID", "int", 4)]
        public int CompanyID { get; set; }

        /// <summary>
        /// CompanyID 关联的公司信息
        /// </summary>         
          public  mCompanyDataModel Sub_Company {
            get {
                return GetSubData<mCompanyDataModel>(this.CompanyID, "Key");
            }
            set{
                SetSubData<mCompanyDataModel>(this.CompanyID, "Key",value);
            }
        }

        ///// <summary>
        ///// 主站用户id
        ///// </summary>
        //[DataMember]
        //[CommonsLib.ORM.DataField("WebUserID", "int", 4)]
        //public int WebUserID { get; set; }


        /// <summary>
        /// 是否是各个公司的网上用户
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("Is_Admin", "bit", 1)]
        public bool Is_Admin { get; set; }


        /// <summary>
        /// 是不是系统客服。
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("Is_CustSup", "bit", 1)]
        public bool Is_CustSup { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("UserName", "nvarchar", 20)]
        public string Name { get; set; }

        /// <summary>
        /// 用户昵称
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("NickName", "nvarchar", 50)]
        public string NickName { get; set; }

        /// <summary>
        /// 用户昵称 拼音
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("NickNamePY", "nvarchar", 50)]
        public string NickNamePY { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("PassWord", "nvarchar", 32)]
        public string PassWord { get; set; }

        [DataMember]
        [CommonsLib.ORM.DataField("RecStamp", "timestamp" )]
        public byte[] RecStamp { get; set; }

        public override string ToString()
        {
            return string.Format("{0}.{1}", "mUser_Main", this.Key);
        }



        /// <summary>
        /// 使用的皮肤
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("SkinName", "varchar", 50)]
        public string SkinName { get; set; }

        /// <summary>
        /// 权限组编号
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("PermitGroup", "int", 4)]
        public int PermitGroup { get; set; }


        [DataMember]
        [CommonsLib.ORM.DataField("Is_Delete", "bool", 1)]
        public bool Is_Delete { get; set; }

        /// <summary>
        /// 是否库存审核人
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("is_LocAppro", "bool", 1)]
        public bool is_LocAppro { get; set; }


         /// <summary>
        /// 是否子公司添加时的管理员账号
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("Is_CompanyUser", "bool", 1)]
        public bool Is_CompanyUser { get; set; }


        

        /// <summary>
        /// 创建时间
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("CreateDate")]
        public DateTime CreateDate { get; set; }



        /// <summary>
        /// 描述
        /// </summary>
        [DataMember]
        [CommonsLib.ORM.DataField("Description", "nvarchar", 200)]
        public string Description { get; set; }

    }
}
